from django.db import models
import django.utils.timezone as timezone
# Create your models here.
#接口测试相关数据表

class t_group(models.Model):
    id = models.BigAutoField(max_length=30, primary_key=True)
    group_name = models.CharField(max_length=255)
    is_delete = models.IntegerField(default=0)
    createTime = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = "t_group"

class t_total(models.Model):
    id = models.BigAutoField(max_length=30, primary_key=True)
    g_id = models.IntegerField()
    itf_name = models.CharField(max_length=255)
    itf_de = models.CharField(max_length=255)
    is_delete = models.IntegerField(default=0)
    createTime = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = "t_total"

class t_interface(models.Model):
    id = models.BigAutoField(max_length=30, primary_key=True)
    c_id= models.IntegerField()
    method = models.CharField(max_length=100)
    url = models.CharField(max_length=100)
    urlde = models.CharField(max_length=255)
    request_format = models.CharField(max_length=100)
    user_load = models.IntegerField(default=0)
    is_delete = models.IntegerField(default=0)
    class Meta:
        db_table = "t_interface"

class t_interface_params(models.Model):
    id = models.BigAutoField(max_length=30, primary_key=True)
    i_id = models.IntegerField()
    param_name = models.CharField(max_length=100)
    describe = models.CharField(max_length=100)
    data_type = models.CharField(max_length=100)
    mandatory = models.BooleanField(default=True)
    is_delete = models.IntegerField(default=0)
    class Meta:
        db_table = "t_interface_params"

class t_user(models.Model):
    userid =  models.BigAutoField(max_length=30, primary_key=True)
    username = models.CharField(max_length=255)
    password = models.CharField(max_length=255)
    groupid = models.IntegerField()
    is_delete = models.IntegerField(default=0)
    createTime = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = "t_user"

class t_address(models.Model):
    addressid = models.BigAutoField(max_length=30, primary_key=True)
    address = models.CharField(max_length=255)
    groupid = models.IntegerField()
    is_delete = models.IntegerField(default=0)
    createTime = models.DateTimeField(default=timezone.now)

    class Meta:
        db_table = "t_address"
